
import 'data.dart';

class Global{
  static int personCount;
  static bool selfInput;
  static String word1;
  static String word2;
  static Data data;
  static WordPair current;
  static const String SELF_WORDS="self_words";

  static void init(){
    data=Data();
    data.init();
  }

  static void add(String word1, String word2){
    Global.word1=word1;
    Global.word2=word2;
    data.addSelf(word1, word2);
  }

  static WordPair genPair(){
    if(Global.selfInput){
      current=WordPair.valueOf(Global.word1, Global.word2);
    }else{
      current=Global.data.getRandom();
    }
    return current;
  }
}